package com.micro.modual.extension;

import com.micro.common.MicroConstant;
import com.micro.common.biz.GeneratorCodeUtil;
import com.micro.common.util.SnowFlakeUtil;
import com.micro.modual.entity.GoodsSku;
import com.micro.modual.model.bo.goodssku.GoodsSkuBO;

/**
 * <h1>商品sku表 延展类</h1>
 *
 * @author LevelCoder
 * @version V1.0.0
 * @email LevelCoder@126.com
 * @date 2020-08-04 00:23:27
 */
public class GoodsSkuExtension {

    /**
     * <h2>转换: 商品sku表 新增</h2>
     *
     * @param goodsSkuBO {@link GoodsSkuBO} 商品sku表 新增/修改 请求对象
     * @return {@link GoodsSku} 商品sku表
     */
    public static GoodsSku converAddGoodsSku(GoodsSkuBO goodsSkuBO) {
        GoodsSku goodsSku = new GoodsSku();
        goodsSku.setId(SnowFlakeUtil.getId());
        goodsSku.setSkuName(goodsSkuBO.getSkuName());
        goodsSku.setGoodsPrice(goodsSkuBO.getGoodsPrice());
        goodsSku.setStockNum(goodsSkuBO.getStockNum());
        goodsSku.setAlertStockNum(goodsSkuBO.getAlertStockNum());
        goodsSku.setMasterImage(goodsSkuBO.getMasterImage());
        goodsSku.setRotateImageList(goodsSkuBO.getRotateImageList());
        goodsSku.setGoodsWeight(goodsSkuBO.getGoodsWeight());
        goodsSku.setSpuCode(goodsSkuBO.getSpuCode());
        goodsSku.setCategoryCode(goodsSkuBO.getCategoryCode());
        goodsSku.setCategoryName(goodsSkuBO.getCategoryName());
        goodsSku.setBrandName(goodsSkuBO.getBrandName());
        goodsSku.setGoodsSpec(goodsSkuBO.getGoodsSpec());
        goodsSku.setSalesVolume(goodsSkuBO.getSalesVolume());
        goodsSku.setCommentVolume(goodsSkuBO.getCommentVolume());
        goodsSku.setGoodsStatus(goodsSkuBO.getGoodsStatus());
        goodsSku.setCreateTime(goodsSkuBO.getCreateTime());
        goodsSku.setUpdateTime(goodsSkuBO.getUpdateTime());
        goodsSku.setGoodsBarCode(goodsSkuBO.getGoodsBarCode());
        goodsSku.setSkuCode(goodsSkuBO.getSkuCode());
        return goodsSku;
    }

    /**
     * <h2>转换: 商品sku表 修改</h2>
     *
     * @param goodsSkuBO {@link GoodsSkuBO} 商品sku表 新增/修改 请求对象
     * @return {@link GoodsSku} 商品sku表
     */
    public static GoodsSku converEditGoodsSku(GoodsSkuBO goodsSkuBO) {
        GoodsSku goodsSku = new GoodsSku();
        goodsSku.setId(goodsSkuBO.getId());
        goodsSku.setSkuName(goodsSkuBO.getSkuName());
        goodsSku.setGoodsPrice(goodsSkuBO.getGoodsPrice());
        goodsSku.setStockNum(goodsSkuBO.getStockNum());
        goodsSku.setAlertStockNum(goodsSkuBO.getAlertStockNum());
        goodsSku.setMasterImage(goodsSkuBO.getMasterImage());
        goodsSku.setRotateImageList(goodsSkuBO.getRotateImageList());
        goodsSku.setGoodsWeight(goodsSkuBO.getGoodsWeight());
        goodsSku.setSpuCode(goodsSkuBO.getSpuCode());
        goodsSku.setCategoryCode(goodsSkuBO.getCategoryCode());
        goodsSku.setCategoryName(goodsSkuBO.getCategoryName());
        goodsSku.setBrandName(goodsSkuBO.getBrandName());
        goodsSku.setGoodsSpec(goodsSkuBO.getGoodsSpec());
        goodsSku.setSalesVolume(goodsSkuBO.getSalesVolume());
        goodsSku.setCommentVolume(goodsSkuBO.getCommentVolume());
        goodsSku.setGoodsStatus(goodsSkuBO.getGoodsStatus());
        goodsSku.setCreateTime(goodsSkuBO.getCreateTime());
        goodsSku.setUpdateTime(goodsSkuBO.getUpdateTime());
        goodsSku.setGoodsBarCode(goodsSkuBO.getGoodsBarCode());
        goodsSku.setSkuCode(goodsSkuBO.getSkuCode());
        return goodsSku;
    }
}
